package com.cipe.cmrs.model;

import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * <p>
 * Pojo mapping TABLE dbo.Partner
 * </p>
 * 
 * <p>
 * Generated at Sat Dec 03 14:39:46 PKT 2011
 * </p>
 * 
 * @author Incepio
 * 
 */
@Entity
@Table(name = "Partner")
@SuppressWarnings("serial")
public class Partner extends BaseAuditEntity {

	/**
	 * Attribute accountingQuestionCompleteDate.
	 */
	@Transient
	private Timestamp accountingQuestionCompleteDate;
	/**
	 * Attribute accountingQuestionEndDate.
	 */
	@Transient
	private Timestamp accountingQuestionEndDate;
	/**
	 * Attribute accountingQuestionStartDate.
	 */
	@Transient
	private Timestamp accountingQuestionStartDate;
	/**
	 * Attribute address1.
	 */
	@Basic
	@Column(name = "address1", length = 100)
	private String address1;
	/**
	 * Attribute address2.
	 */
	@Basic
	@Column(name = "address2", length = 100)
	private String address2;
	/**
	 * List of Cipeproject
	 */
	@OneToMany(mappedBy = "partner")
	private List<Cipeproject> cipeprojects = null;
	/**
	 * Attribute city.
	 */
	@Basic
	@Column(name = "city", length = 50)
	private String city;
	/**
	 * Attribute contactEmail.
	 */
	@Basic
	@Column(name = "contactemail", length = 50)
	private String contactEmail;
	/**
	 * Attribute contactFax.
	 */
	@Basic
	@Column(name = "contactfax", length = 20)
	private String contactFax;
	/**
	 * Attribute contactFirstName.
	 */
	@Basic
	@Column(name = "contactfirstname", length = 100)
	private String contactFirstName;
	/**
	 * Attribute contactLastName.
	 */
	@Basic
	@Column(name = "contactlastname", length = 100)
	private String contactLastName;
	/**
	 * Attribute contactMiddleName.
	 */
	@Basic
	@Column(name = "contactmiddlename", length = 100)
	private String contactMiddleName;
	/**
	 * Attribute contactPhone.
	 */
	@Basic
	@Column(name = "contactphone", length = 20)
	private String contactPhone;
	/**
	 * Attribute country
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "countryid")
	private Country country;
	/**
	 * Attribute email.
	 */
	@Basic
	@Column(name = "email", length = 50)
	private String email;
	/**
	 * Attribute fax.
	 */
	@Basic
	@Column(name = "fax", length = 20)
	private String fax;
	/**
	 * Attribute partnerName.
	 */
	@Basic
	@Column(name = "partnername", length = 100)
	private String partnerName;
	/**
	 * Attribute phone.
	 */
	@Basic
	@Column(name = "phone", length = 20)
	private String phone;
	/**
	 * Attribute riskAssess.
	 */
	@Transient
	private String riskAssess;
	/**
	 * Attribute state.
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "stateid")
	private State state;
	@Transient
	private String status;
	@Transient
	private String type;
	/**
	 * Attribute url.
	 */
	@Basic
	@Column(name = "url", length = 400)
	private String url;
	/**
	 * Attribute zipCode.
	 */
	@Basic
	@Column(name = "zipcode", length = 10)
	private String zipCode;

	@Transient
	private Integer cipeprojectId;
	@Transient
	private Boolean fromProject;

	/**
	 * @return the fromProject
	 */
	public Boolean getFromProject() {
		return fromProject;
	}

	/**
	 * @param fromProject
	 *            the fromProject to set
	 */
	public void setFromProject(Boolean fromProject) {
		this.fromProject = fromProject;
	}

	/**
	 * @return accountingQuestionCompleteDate
	 */
	public Timestamp getAccountingQuestionCompleteDate() {
		return accountingQuestionCompleteDate;
	}

	/**
	 * @return accountingQuestionEndDate
	 */
	public Timestamp getAccountingQuestionEndDate() {
		return accountingQuestionEndDate;
	}

	/**
	 * @return accountingQuestionStartDate
	 */
	public Timestamp getAccountingQuestionStartDate() {
		return accountingQuestionStartDate;
	}

	/**
	 * @return address1
	 */
	public String getAddress1() {
		return address1;
	}

	/**
	 * @return address2
	 */
	public String getAddress2() {
		return address2;
	}

	/**
	 * Get the list of Cipeproject
	 */
	public List<Cipeproject> getCipeprojects() {
		return this.cipeprojects;
	}

	/**
	 * @return city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * @return contactEmail
	 */
	public String getContactEmail() {
		return contactEmail;
	}

	/**
	 * @return contactFax
	 */
	public String getContactFax() {
		return contactFax;
	}

	/**
	 * @return contactFirstName
	 */
	public String getContactFirstName() {
		return contactFirstName;
	}

	/**
	 * @return contactLastName
	 */
	public String getContactLastName() {
		return contactLastName;
	}

	/**
	 * @return contactMiddleName
	 */
	public String getContactMiddleName() {
		return contactMiddleName;
	}

	/**
	 * @return contactPhone
	 */
	public String getContactPhone() {
		return contactPhone;
	}

	/**
	 * get country
	 */
	public Country getCountry() {
		return this.country;
	}

	/**
	 * @return email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @return fax
	 */
	public String getFax() {
		return fax;
	}

	/**
	 * @return partnerName
	 */
	public String getPartnerName() {
		return partnerName;
	}

	/**
	 * @return phone
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * @return riskAssess
	 */
	public String getRiskAssess() {
		return riskAssess;
	}

	public String getStatus() {
		return status;
	}

	public String getType() {
		return type;
	}

	/**
	 * @return url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @return zipCode
	 */
	public String getZipCode() {
		return zipCode;
	}

	/**
	 * @param accountingQuestionCompleteDate
	 *            new value for accountingQuestionCompleteDate
	 */
	public void setAccountingQuestionCompleteDate(Timestamp accountingQuestionCompleteDate) {
		this.accountingQuestionCompleteDate = accountingQuestionCompleteDate;
	}

	/**
	 * @param accountingQuestionEndDate
	 *            new value for accountingQuestionEndDate
	 */
	public void setAccountingQuestionEndDate(Timestamp accountingQuestionEndDate) {
		this.accountingQuestionEndDate = accountingQuestionEndDate;
	}

	/**
	 * @param accountingQuestionStartDate
	 *            new value for accountingQuestionStartDate
	 */
	public void setAccountingQuestionStartDate(Timestamp accountingQuestionStartDate) {
		this.accountingQuestionStartDate = accountingQuestionStartDate;
	}

	/**
	 * @param address1
	 *            new value for address1
	 */
	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	/**
	 * @param address2
	 *            new value for address2
	 */
	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	/**
	 * Set the list of Cipeproject
	 */
	public void setCipeprojects(List<Cipeproject> cipeprojects) {
		this.cipeprojects = cipeprojects;
	}

	/**
	 * @param city
	 *            new value for city
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @param contactEmail
	 *            new value for contactEmail
	 */
	public void setContactEmail(String contactEmail) {
		this.contactEmail = contactEmail;
	}

	/**
	 * @param contactFax
	 *            new value for contactFax
	 */
	public void setContactFax(String contactFax) {
		this.contactFax = contactFax;
	}

	/**
	 * @param contactFirstName
	 *            new value for contactFirstName
	 */
	public void setContactFirstName(String contactFirstName) {
		this.contactFirstName = contactFirstName;
	}

	/**
	 * @param contactLastName
	 *            new value for contactLastName
	 */
	public void setContactLastName(String contactLastName) {
		this.contactLastName = contactLastName;
	}

	/**
	 * @param contactMiddleName
	 *            new value for contactMiddleName
	 */
	public void setContactMiddleName(String contactMiddleName) {
		this.contactMiddleName = contactMiddleName;
	}

	/**
	 * @param contactPhone
	 *            new value for contactPhone
	 */
	public void setContactPhone(String contactPhone) {
		this.contactPhone = contactPhone;
	}

	/**
	 * set country
	 */
	public void setCountry(Country country) {
		this.country = country;
	}

	/**
	 * @param email
	 *            new value for email
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @param fax
	 *            new value for fax
	 */
	public void setFax(String fax) {
		this.fax = fax;
	}

	/**
	 * @param partnerName
	 *            new value for partnerName
	 */
	public void setPartnerName(String partnerName) {
		this.partnerName = partnerName;
	}

	/**
	 * @param phone
	 *            new value for phone
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * @param riskAssess
	 *            new value for riskAssess
	 */
	public void setRiskAssess(String riskAssess) {
		this.riskAssess = riskAssess;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @param url
	 *            new value for url
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * @param zipCode
	 *            new value for zipCode
	 */
	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	/**
	 * @return the cipeprojectId
	 */
	public Integer getCipeprojectId() {
		return cipeprojectId;
	}

	/**
	 * @param cipeprojectId
	 *            the cipeprojectId to set
	 */
	public void setCipeprojectId(Integer cipeprojectId) {
		this.cipeprojectId = cipeprojectId;
	}

	@Transient
	public String getShortPartnerName() {
		return (partnerName != null && partnerName.length() > 50) ? partnerName.substring(0, 49) : partnerName;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}
}